package com.qcsec.domain.dto;

import com.qcsec.domain.entity.SysUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SysUserMsMapper {
    SysUserMsMapper INSTANCE = Mappers.getMapper(SysUserMsMapper.class);

    @Mapping(target = "role", ignore = true)
    @Mapping(source = "passwd", target = "password")
    SysUser toEntity(SysUserDto dto);

    @Mapping(source = "passwd", target = "password")
    List<SysUser> toEntityList(List<SysUserDto> dtoList);

    @Mapping(source = "password", target = "passwd")
    SysUserDto toDto(SysUser entity);

    @Mapping(source = "password", target = "passwd")
    List<SysUserDto> toDtoList(List<SysUser> entityList);
}
